<script setup>
import { getMachineOutValue } from '@/api/decision/production'
import moment from 'moment'

const config = ref({
  unit: '小时',
  data: [],
  rowNum: 8
})

const loadData = async () => {
  const { data, total } = await getMachineOutValue({
    date: [moment().format('YYYYMMDD'), moment().format('YYYYMMDD')]
  })

  config.value.data = data.map(item => {
    return {
      name: `<div class="ps_text_ellipsis" style="text-align: center;width:100px" > ${item.UName} </div> `,
      value: item.sjgs
    }
  })
}

onMounted(loadData)
</script>

<template>
  <div class="ps_w_h_100">
    <div class="board-title">今日OEE分析</div>

    <dv-scroll-ranking-board :config="config" />
  </div>
</template>

<style scoped lang="scss"></style>
